package org.llp.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.llp.basic.domain.BaseDepartment;
import org.llp.employee.domain.Employee;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
public class Department extends BaseDepartment {

    @ApiModelProperty("名字")
    private String name;
    @ApiModelProperty("描述")
    private String intro;
    @ApiModelProperty("创建时间")
    private Date create_time;
    @ApiModelProperty("修改时间")
    private Date update_time;

    //部门经理
    @ApiModelProperty("部门领导")
    private Employee manager;
    //上级部门
    @ApiModelProperty("父部门")
    private Department parent;

    private List<Department> children;//子部门集合
    @ApiModelProperty("部门pate")
    private String path;
    @ApiModelProperty("状态")
    private Integer state;

    //重写时间getset方法


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getCreate_time() {
        return create_time;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getUpdate_time() {
        return update_time;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }
}
